home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / clang / ebksrc.zip / EB.CPP < prev    next >
C/C++ Source or Header  |  1991-08-11  |  2KB  |  120 lines

  1. /*
  2.  
  3.     eb.cpp
  4.     8-11-91
  5.     Electronic Book
  6.  
  7.  
  8.     Copyright 1991
  9.     John W. Small
  10.     All rights reserved
  11.  
  12.     Licensed users of FlexList may use and modify this
  13.     tool for use in their programs.
  14.  
  15.  
  16.     PSW / Power SoftWare
  17.     P.O. Box 10072
  18.     McLean, Virginia 22102 8072 USA
  19.  
  20.     Voice: (703) 759-3838
  21.     CIS: 73757,2233
  22.  
  23.  
  24.     Notes:  The Electronic Book was coded to demonstrate
  25.     the various uses of FlexList.
  26.  
  27.  
  28. */
  29.  
  30. #include <conio.h>
  31. #include <eb4.hpp>
  32. #include <cmdln.hpp>
  33. #include <pckey.hpp>
  34.  
  35.  
  36. int origmode;
  37. int origattr;
  38.  
  39. void EBfrontCover()
  40. {
  41.     struct text_info ti;
  42.  
  43.     gettextinfo(&ti);
  44.     origmode = ti.currmode;
  45.     origattr = ti.normattr;
  46. }
  47.  
  48. void EBbackCover()
  49. {
  50.     struct text_info ti;
  51.  
  52.     gettextinfo(&ti);
  53.     if (origmode != ti.currmode)  {
  54.         textmode(C80);
  55.         textattr(LIGHTGRAY+BLACK*16);
  56.         clrscr();
  57.     }
  58.     else
  59.         textattr(origattr);
  60.  
  61. cout
  62.  
  63. << "\n\nCopyright 1991, John W. Small, All rights reserved"
  64. << "\nPSW / Power SoftWare,  P.O. Box 10072"
  65. << "\nMcLean, Virginia 22102 8072 USA"
  66. << "\n"
  67. << "\nEB.EXE is freeware, meaning that there is no fee for using"
  68. << "\nEB.EXE or redistributing it at a nominal cost reflecting your"
  69. << "\nreasonable distribution costs.  You are unauthorized to make"
  70. << "\nany changes to this program!  This program was written using"
  71. << "\nFlexList II for C++.\n";
  72.  
  73. }
  74.  
  75.  
  76. main(int argc, char *argv[])
  77. {
  78.     CmdLn CL(argc,argv,"mMt:T:");
  79.     char * fname = (char *) 0;
  80.     char * topic = (char *) 0;
  81.     int ok = 1;
  82.  
  83.     do  {
  84.         while (CL.getOption() != -1 && ok)
  85.             switch (CL.optCh)  {
  86.             case '?':
  87.                 ok = 0;
  88.                 break;
  89.             case 'm':
  90.             case 'M':
  91.                 forcedmonochrome = 1;
  92.                 break;
  93.             case 't':
  94.             case 'T':
  95.                 topic = CL.optArg;
  96.                 break;
  97.             }
  98.         if (CL.Argi() < argc)
  99.             fname =  argv[CL.Argi()];
  100.         CL.lookForMoreOptions();
  101.     } while (CL.Argi() < argc && ok);
  102.  
  103.     if (ok)  {
  104.         HyperView EB;
  105.         EBfrontCover();
  106.         EB.viewFullScreen(fname,topic);
  107.         EBbackCover();
  108.     }
  109.     else
  110.  
  111. cout
  112. << "\n\nusage: eb [-m] [[-ttopic] filename]"
  113. << "\n\n\t[-m]\t\t\toptionally force monochrome display"
  114. << "\n\t[[-ttopic] filename]\toptionally load hypertext file and topic"
  115. << "\n\n";
  116.  
  117.  
  118.     PCK.fastTypeMaticOnExit();
  119.     return 0;
  120. }